-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat(backend, sdk): Add custom_path field to RuntimeArtifact #12248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(backend, sdk): Add custom_path field to RuntimeArtifact #12248
Conversation
|
Skipping CI for Draft Pull Request. |
daab84c to
2120dcd
Compare
2120dcd to
545a55f
Compare
7934fc1 to
e24f5b1
Compare
29c50a9 to
23b7804
Compare
329d06d to
4d5465a
Compare
4d5465a to
a174e85
Compare
| if outputArtifact.CustomPath != nil { | ||
| localDir = *outputArtifact.CustomPath | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Am I missing something, or does this "duplicate" the above statement?
It seems like it can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right - I refactored the retrieveArtifactPath() logic after implementing this code block, so I completely missed it. Updated now
backend/src/v2/driver/driver.go
Outdated
| func localPathForURI(uri string) (string, error) { | ||
| if strings.HasPrefix(uri, "gs://") { | ||
| return "/gcs/" + strings.TrimPrefix(uri, "gs://"), nil | ||
| } | ||
| if strings.HasPrefix(uri, "minio://") { | ||
| return "/minio/" + strings.TrimPrefix(uri, "minio://"), nil | ||
| } | ||
| if strings.HasPrefix(uri, "s3://") { | ||
| return "/s3/" + strings.TrimPrefix(uri, "s3://"), nil | ||
| } | ||
| if strings.HasPrefix(uri, "oci://") { | ||
| return "/oci/" + strings.ReplaceAll(strings.TrimPrefix(uri, "oci://"), "/", "_") + "/models", nil | ||
| } | ||
| return "", fmt.Errorf("failed to generate local path for URI %s: unsupported storage scheme", uri) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This duplicates the logic from backend/src/v2/component/launcher_v2.go.
Can we keep the component.LocalPathForURI function and use that in retrieveArtifactPath (in else)? With that, we can revert all the changes in this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep - updated
be47260 to
815bbf2
Compare
|
@alyssacgoins can you please rebase? |
815bbf2 to
d7399d7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
d7399d7 to
b0371c0
Compare
|
/retest |
|
/lgtm |
30bb62d to
d7399d7
Compare
d7399d7 to
5551af8
Compare
Signed-off-by: agoins <[email protected]>
Signed-off-by: agoins <[email protected]>
5551af8 to
fe7b8f9
Compare
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: droctothorpe The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
Resolves #12386
Description of your changes:
Add a
custom_pathfield to theRuntimeArtifactobject that overrides the object's URI field during artifact upload, allowing artifacts to be uploaded from non-local storage.Changes validated via unit test in
launcher_v2.Test_retrieve_artifact_path()as well as the sample pipelinecomponent_with_runtime_artifact_custom_path.pyadded totest_data/sdk_compiled_pipelines/valid/critical, which sets and validates a custom artifact path.Checklist: